/*
package NiuKe;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

*/
/**
 * @Description:
 * @Author: Hanzao
 * @Date: 2022/06/21/1:24
 *//*

public class HJ94 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num1 = scanner.nextInt();
        Map<String ,Integer> map = new HashMap<>();
        map.put("Invalid",0);
        for(int i=0;i<num1;i++){
            map.put(scanner.next(),0);
        }
        int num2 = scanner.nextInt();
        for(int i=0;i<num2;i++){
            String s = scanner.next();
            if(map.containsKey(s)){
                map.put(s,map.get(s)+1);
            }else{
                map.put("Invalid",map.get("Invalid")+1);
            }
        }
        for(String ss: map.keySet()){
            System.out.println(ss+" : "+map.get(ss));
        }
    }
}
*/
